﻿using System.Collections.Generic;

namespace RoadPlot
{
    public class RoadLegend
    {
        private RoadLegend(EnumCurveyTerminus enumCurveyTerminus, string text, double offset, double leadingBlank)
        {
            _enumCurveyTerminus = enumCurveyTerminus;
            _text = text;
            _offset = offset;
            _leadingBlank = leadingBlank;
        }

        public static List<RoadLegend> RoadLengendFactory(string text, double leadingBlank)
        {
            if (text.Length == 0)
                return null;

            var legends = new List<RoadLegend>
                              {
                                  new RoadLegend(EnumCurveyTerminus.Start, text, 0, leadingBlank),
                                  new RoadLegend(EnumCurveyTerminus.End, text, 0, leadingBlank),
                                  new RoadLegend(EnumCurveyTerminus.Middle, text, 0.5, leadingBlank)
                              };
            return legends;
        }

        public readonly EnumCurveyTerminus _enumCurveyTerminus;
        public readonly string _text;
        public readonly double _offset;
        public readonly double _leadingBlank;
    }
}
